home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1995 February: Tool Chest / Dev.CD Feb 95 / Dev.CD Feb 95.toast / Tool Chest / Interfaces / Universal Interfaces 2.0a3 / Universal AIncludes / Aliases.a < prev    next >
Encoding:
Text File  |  1994-11-11  |  4.0 KB  |  166 lines  |  [TEXT/MPS ]

  1. ;
  2. ;    File:        Aliases.a
  3. ;
  4. ;    Copyright:    © 1984-1994 by Apple Computer, Inc.
  5. ;                All rights reserved.
  6. ;
  7. ;    Version:    Universal Interfaces 2.0a3  ETO #16, MPW prerelease.  Friday, November 11, 1994. 
  8. ;
  9. ;    Bugs?:        If you find a problem with this file, send the file and version
  10. ;                information (from above) and the problem description to:
  11. ;
  12. ;                    Internet:    apple.bugs@applelink.apple.com
  13. ;                    AppleLink:    APPLE.BUGS
  14. ;
  15. ;
  16.  
  17.     IF &TYPE('__ALIASES__') = 'UNDEFINED' THEN
  18. __ALIASES__ SET 1
  19.  
  20.  
  21.     IF &TYPE('__TYPES__') = 'UNDEFINED' THEN
  22.     include 'Types.a'
  23.     ENDIF
  24. ;        include 'ConditionalMacros.a'                                ;
  25.  
  26.     IF &TYPE('__APPLETALK__') = 'UNDEFINED' THEN
  27.     include 'AppleTalk.a'
  28.     ENDIF
  29. ;        include 'OSUtils.a'                                        ;
  30. ;            include 'MixedMode.a'                                    ;
  31. ;            include 'Memory.a'                                        ;
  32.  
  33.     IF &TYPE('__FILES__') = 'UNDEFINED' THEN
  34.     include 'Files.a'
  35.     ENDIF
  36.  
  37. rAliasType                        EQU        'alis'                ; Aliases are stored as resources of this type 
  38. ; define alias resolution action rules mask 
  39. kARMMountVol                    EQU        $00000001            ; mount the volume automatically 
  40. kARMNoUI                        EQU        $00000002            ; no user interface allowed during resolution 
  41. kARMMultVols                    EQU        $00000008            ; search on multiple volumes 
  42. kARMSearch                        EQU        $00000100            ; search quickly 
  43. kARMSearchMore                    EQU        $00000200            ; search further 
  44. kARMSearchRelFirst                EQU        $00000400            ; search target on a relative path first 
  45. ; define alias record information types 
  46. asiZoneName                        EQU        -3                    ; get zone name 
  47. asiServerName                    EQU        -2                    ; get server name 
  48. asiVolumeName                    EQU        -1                    ; get volume name 
  49. asiAliasName                    EQU        0                    ; get aliased file/folder/volume name 
  50. asiParentName                    EQU        1                    ; get parent folder name 
  51.  
  52. ; define the alias record that will be the blackbox for the caller 
  53. AliasRecord             RECORD    0
  54. userType                 ds.l    1                                    ; appl stored type like creator type 
  55. aliasSize                 ds.w    1                                    ; alias record size in bytes, for appl usage 
  56. sizeof                     EQU    6
  57.                         ENDR
  58.  
  59. ; alias record information type 
  60.     IF GENERATING68K THEN
  61.         Macro
  62.         _NewAlias
  63.             moveq    #2,d0
  64.             dc.w     $A823
  65.         EndM
  66.     ELSE
  67.         IMPORT    NewAlias
  68.     ENDIF
  69.  
  70. ; create a minimal new alias for a target and return alias record handle 
  71.     IF GENERATING68K THEN
  72.         Macro
  73.         _NewAliasMinimal
  74.             moveq    #8,d0
  75.             dc.w     $A823
  76.         EndM
  77.     ELSE
  78.         IMPORT    NewAliasMinimal
  79.     ENDIF
  80.  
  81. ; create a minimal new alias from a target fullpath (optional zone and server name) and return alias record handle  
  82.     IF GENERATING68K THEN
  83.         Macro
  84.         _NewAliasMinimalFromFullPath
  85.             moveq    #9,d0
  86.             dc.w     $A823
  87.         EndM
  88.     ELSE
  89.         IMPORT    NewAliasMinimalFromFullPath
  90.     ENDIF
  91.  
  92. ; given an alias handle and fromFile, resolve the alias, update the alias record and return aliased filename and wasChanged flag. 
  93.     IF GENERATING68K THEN
  94.         Macro
  95.         _ResolveAlias
  96.             moveq    #3,d0
  97.             dc.w     $A823
  98.         EndM
  99.     ELSE
  100.         IMPORT    ResolveAlias
  101.     ENDIF
  102.  
  103. ; given an alias handle and an index specifying requested alias information type, return the information from alias record as a string. 
  104.     IF GENERATING68K THEN
  105.         Macro
  106.         _GetAliasInfo
  107.             moveq    #7,d0
  108.             dc.w     $A823
  109.         EndM
  110.     ELSE
  111.         IMPORT    GetAliasInfo
  112.     ENDIF
  113.  
  114. ;  Given a file spec, return target file spec if input file spec is an alias.
  115. ;  It resolves the entire alias chain or one step of the chain.  It returns
  116. ;  info about whether the target is a folder or file; and whether the input
  117. ;  file spec was an alias or not. 
  118. ;
  119.     IF GENERATING68K THEN
  120.         Macro
  121.         _ResolveAliasFile
  122.             moveq    #12,d0
  123.             dc.w     $A823
  124.         EndM
  125.     ELSE
  126.         IMPORT    ResolveAliasFile
  127.     ENDIF
  128.  
  129.     IF GENERATING68K THEN
  130.         Macro
  131.         _FollowFinderAlias
  132.             moveq    #15,d0
  133.             dc.w     $A823
  134.         EndM
  135.     ELSE
  136.         IMPORT    FollowFinderAlias
  137.     ENDIF
  138.  
  139. ;   Low Level Routines 
  140. ; Given an alias handle and fromFile, match the alias and return aliased filename(s) and needsUpdate flag
  141. ;
  142.     IF GENERATING68K THEN
  143.         Macro
  144.         _MatchAlias
  145.             moveq    #5,d0
  146.             dc.w     $A823
  147.         EndM
  148.     ELSE
  149.         IMPORT    MatchAlias
  150.     ENDIF
  151.  
  152. ; given a fromFile-target pair and an alias handle, update the lias record pointed to by alias handle to represent target as the new alias. 
  153.     IF GENERATING68K THEN
  154.         Macro
  155.         _UpdateAlias
  156.             moveq    #6,d0
  157.             dc.w     $A823
  158.         EndM
  159.     ELSE
  160.         IMPORT    UpdateAlias
  161.     ENDIF
  162.  
  163.     ENDIF ; __ALIASES__
  164.